For each of the functions listed in this section, you can click the corresponding button in the example.
Val( )
Val() returns a numeric value for a string variable. If the converted string contains characters other than numbers, Val() converts up to the nonnumeric character. Heres an example:
Private Sub cmdVal_Click ()
Me.Print "Val(""100"") " & Val("100")
Me.Print "Val(""10a0"") " & Val("10a0")
Me.Print "Val(""a100"") " & Val("a100")
End Sub
Heres the output:
100
10
0
CCur( )
CCur() converts any numeric or string expression into a currency value. Heres an example:
Private Sub cmdCCur_Click ()
Dim curAmount As Currency